<?php
#
# Author: Cody Sorgenfrey 
#

include_once('../common.php');

function mlive_video() {
    $now = time();
    $day = date('w', $now);
    $currentTime = date('H:i',$now);
    
    $SatStart="18:15";
    $SatEnd="20:00";
    $WedStart="18:45";
    $WedEnd="20:30";
    $SunStart="08:45";
    $SunEnd="10:30";
    
    if (($day == 0 && CheckTime($currentTime,$SunStart,$SunEnd)) ||
        ($day == 3 && CheckTime($currentTime,$WedStart,$WedEnd))) {
        printf("<div id='banner'>\n");
        $banner = "<h6 id='banner'>Come Join Our Service<font color='#b1001b'> Happening Now!</font></h6>";
        printf("<a href='./video_live.php'>%s</a>\n", $banner);
        printf("<script>print_space()</script>");
        printf("</div>\n");
    }
}

function print_menu_bar(){

    //menu bar (invisible) at top of page contains 3 sections; left, right and center (center is contained in the left div)
    printf("<div class='menuBarLeft'>\n");
    printf("\t<img id='menuButton' onclick='slidePage()' src='/images/menuButton.png' alt='Menu'></img>\n");
    printf("\t<div class='menuBarCenter'>");
    mlive_video();
    printf("\t</div>\n");
    printf("</div>\n\n");
    printf("<div class='menuBarRight'>\n");
    printf("\t<img id='shareButton' onclick='slideShareSheet()' src='/images/shareButton.png' alt='Share'></img>\n");
    printf("</div>\n\n");
}

function printShareSheet(){
	
	//share sheet menu
    printf("<div id='shareSheet' class='shareSheet'>\n");
    printf("\t<table style='width:%s;'>\n", "100%");
    printf("<tr><td style='width:%s;'>\n", "50%");
    $page = Url();	
    printf("\t\t<iframe id='fb' src='//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.southhillcalvary.org&amp;send=false&amp;layout=button_count&amp;width=90&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=21' scrolling='no' frameborder='0' style='border:none; overflow:hidden; width:90px; height:25px;' allowTransparency='true'></iframe>\n", Null, Null, Null);
    printf("</td><td style='width:%s;'>\n", "50%");
    printf("\t\t<div id='twit'><a href='https://twitter.com/share' class='twitter-share-button' data-size='large' data-count='none'>Tweet</a><script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src='//platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document,'script','twitter-wjs');</script></div>\n");
    printf("</td></tr><tr><td style='width:%s;'>\n", "50%");
    printf("\t\t<a href='mailto:?subject=Check&nbsp;this&nbsp;out!&body=%s'><div id='mail'>Mail</div></a><br>\n", $page, "80%");
    printf("</td><td style='width:%s;'>\n", "50%");    
    printf("\t\t<a href='http://www.vimeo.com/southhillcalvary' target='_blank'><div id='vimeo' >Vimeo</div></a>\n", "80%");
    printf("\t</td></tr></table>\n");
    printf("</div>\n\n");
}

function printMainMenuAndStuff(){    
    
    //creates our main navigation menu
    printf("<div id='mainMenu' class='mainMenu'>\n");
    printf("\t<div id='scrollAble'>\n");
    printf("\t\t<div class='navFirstButton' onclick='link(\"/\")'><h2 style='margin-top:10px;'>Home</h2></div>\n");
    printf("\t\t<div class='navButtons' id='aboutUsButton' onclick='slideSubMenu(\"aboutUs\")' width='150px' ><h2 style='margin-top:10px;'>About Us</h2></div>\n"); 
    printf("\t\t<div class='navButtons' id='gatheringsButton' onclick='slideSubMenu(\"gatherings\")' width='150px' ><h2 style='margin-top:10px;'>Gatherings</h2></div>\n");
    printf("\t\t<div class='navButtons' id='ministriesButton' onclick='slideSubMenu(\"ministries\")' width='150px' ><h2 style='margin-top:10px;'>Ministries</h2></div>\n");
    printf("\t\t<div class='navButtons' id='resourcesButton' onclick='slideSubMenu(\"resources\")' width='150px' ><h2 style='margin-top:10px;'>Resources</h2></div>\n");
    printf("\t\t<div class='navButtons' id='teachingsButton' onclick='slideSubMenu(\"teachings\")' width='150px' ><h2 style='margin-top:10px;'>Teachings</h2></div>\n");
    printf("\t\t<div class='navButtons' id='contactButton' onclick='slideSubMenu(\"contact\")' width='150px' ><h2 style='margin-top:10px;'>Contact</h2></div>\n");
    printf("\t\t<div class='navButtons' id='givingButton' width='150px' onclick='link(\"/donations.php\")'><h2 style='margin-top:10px;'>Giving</h2></div>\n");
    printf("\t</div>\n</div>\n\n");
    
    //creates our sub menu of main nav menu (is not contained within the main nav menu div for display purposes)
    printf("<div id='subMenu' class='subMenu'>\n");
    printf("<div id='scrollAble'>\n");
    //aboutUs
    printf("<div class='subMenuButtons' id='aboutUs'>\n"); 
    printf("\t<div id='aboutUs' class='subNavFirstButton' onclick='link(\"/beliefs.php\")'><h5 style='margin-top:7px;'>Beliefs</h5></div>\n");
    printf("\t<div id='aboutUs' class='subNavButtons' onclick='link(\"/history.php\")'><h5 style='margin-top:7px;'>History</h5></div>\n");
    printf("\t<div id='aboutUs' class='subNavButtons' onclick='link(\"/staff.php\")'><h5 style='margin-top:7px;'>Staff</h5></div></a>\n");
    printf("\t<div id='aboutUs' class='subNavButtons' onclick='link(\"/leadership.php\")'><h5 style='margin-top:7px;'>Leadership</h5></div></a>\n");
    printf("</div>\n");
    //gatherings
    printf("<div class='subMenuButtons' id='gatherings'>\n"); 
    printf("\t<div id='firstGatherings'  class='subNavFirstButton' onclick='link(\"/services.php\")'><h5 style='margin-top:7px;'>Services</h5></div></a>\n");
    printf("\t<div id='gatheringButtons' class='subNavButtons' onclick='link(\"/events.php\")'><h5 style='margin-top:7px;'>Events</h5></div></a>\n");
    printf("\t<div id='gatheringButtons' class='subNavButtons'  onclick='link(\"/homefellowship.php\")'><h5 style='margin-top:7px;'>Home Fellowship</h5></div></a>\n");
    echo "  \t<div id='gatheringButtons' class='subNavButtons'  onclick='link(\"http://www.google.com/calendar/embed?src=32j8g2dv0hjfpb92ndv99q39kc%40group.calendar.google.com&ctz=America/Los_Angeles\")'><h5 style='margin-top:7px;'>Calendar</h5></div></a>\n";
    printf("\t<div id='gatheringButtons' class='subNavButtons' onclick='link(\"http://www.veritaschristianfellowship.org\")'><h5 style='margin-top:7px;'>Veritas</h5></div></a>\n");
    printf("</div>\n");
    //ministries
    printf("<div class='subMenuButtons' id='ministries'>\n"); 
    printf("\t<div id='firstMinistries' class='subNavFirstButton' onclick='link(\"/mens.php\")'><h5 style='margin-top:7px;'>Men's</h5></div></a>\n");
    printf("\t<div id='ministryButtons' class='subNavButtons' onclick='link(\"/womens.php\")'><h5 style='margin-top:7px;'>Women's</h5></div></a>\n");
    printf("\t<div id='ministryButtons' class='subNavButtons' onclick='link(\"/247.php\")'><h5 style='margin-top:7px;'>High School</h5></div></a>\n");
    printf("\t<div id='ministryButtons' class='subNavButtons' onclick='link(\"/abide.php\")'><h5 style='margin-top:7px;'>Jr. High</h5></div></a>\n");
    printf("\t<div id='ministryButtons' class='subNavButtons' onclick='link(\"/childrens_ministry.php\")'><h5 style='margin-top:7px;'>Children's</h5></div></a>\n");
    printf("\t<div id='ministryButtons' class='subNavButtons' onclick='link(\"/missionaries.php\")'><h5 style='margin-top:7px;'>Missionaries</h5></div></a>\n");
    printf("\t<div id='ministryButtons' class='subNavButtons' onclick='link(\"/ministries.php\")'><h5 style='margin-top:7px;'>More...</h5></div></a>\n");
    printf("</div>\n");
    //resources
    printf("<div class='subMenuButtons' id='resources'>\n"); 
    printf("\t<div id='firstResources'  class='subNavFirstButton' onclick='link(\"/dp.php\")'><h5 style='margin-top:7px;'>Book Store</h5></div></a>\n");
    printf("\t<div id='resourceButtons' class='subNavButtons' onclick='link(\"/lendinglibrary.php\")'><h5 style='margin-top:7px;'>Office Library</h5></div></a>\n");
    printf("\t<div id='resourceButtons' class='subNavButtons' onclick='link(\"/needs.php\")'><h5 style='margin-top:7px;'>Needs Board</h5></div></a>\n");
    printf("\t<div id='resourceButtons' class='subNavButtons' onclick='link(\"/bible1year.php\")'><h5 style='font-size:%s; margin-top:7px;'>Bible in a Year</h5></div></a>\n", "90%");
    printf("\t<div id='resourceButtons' class='subNavButtons' onclick='link(\"http://www.facebook.com/southhillcalvary/\")'><h5 style='margin-top:7px;'>Facebook</h5></div></a>\n");
    printf("\t<div id='resourceButtons' class='subNavButtons' onclick='link(\"http://blog.southhillcalvary.org/\")'><h5 style='margin-top:7px;'>Church Blog</h5></div></a>\n");
    printf("\t<div id='resourceButtons' class='subNavButtons' onclick='link(\"http://www.pastorronsanchez.com/\")'><h5 style='margin-top:7px;'>Pastor's Blog</h5></div></a>\n");
    printf("</div>\n");
    //teachings
    printf("<div class='subMenuButtons' id='teachings'>\n"); 
    printf("\t<div id='firstTeachings'  class='subNavFirstButton' onclick='link(\"/current_teachings.php\")'><h5 style='margin-top:7px;'>Current</h5></div></a>\n");
    printf("\t<div id='teachingButtons' class='subNavButtons' onclick='link(\"/sermon.php\")'><h5 style='margin-top:7px;'>Archived</h5></div></a>\n");
    printf("\t<div id='teachingButtons' class='subNavButtons' onclick='link(\"/sermon_series.php\")'><h5 style='margin-top:7px;'>Series</h5></div></a>\n");
    printf("\t<div id='teachingButtons' class='subNavButtons' onclick='link(\"/video_live.php\")'><h5 style='margin-top:7px;'>Live</h5></div></a>\n");
    printf("\t<div id='teachingButtons' class='subNavButtons' onclick='link(\"/independentstudy.php\")'><h5 style='font-size:%s; margin-top:7px;'>Personal Study</h5></div></a>\n", "90%");
    printf("\t<div id='teachingButtons' class='subNavButtons' onclick='link(\"/podcast.php\")'><h5 style='margin-top:7px;'>Podcast</h5></div></a>\n");
    printf("</div>\n");
    //contact
    printf("<div class='subMenuButtons' id='contact'>\n"); 
    printf("\t<div id='firstContact'   class ='subNavFirstButton' onclick='link(\"/contact.php\")'><h5 style='margin-top:7px;'>Contacts</h5></div></a>\n");
    printf("\t<div id='contactButtons' class='subNavButtons' onclick='link(\"/direction.php\")'><h5 style='margin-top:7px;'>Directions</h5></div></a>\n");
    printf("\t<div id='contactButtons' class='subNavButtons' onclick='link(\"/prayer_request.php\")'><h5 style='margin-top:7px;'>Prayer</h5></div></a>\n");
    printf("\t<div id='contactButtons' class='subNavButtons' onclick='link(\"/directory.php\")'><h5 style='margin-top:7px;'>Directory</h5></div></a>\n");
    printf("</div>\n</div>\n</div>\n");
    
}
?>